
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>购买页面</title>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/shopGoods.js"></script>
</head>
<body>
<div style="width: 1200px;margin: 10px auto">
    <form action="${pageContext.request.contextPath}/buy" method="post" id="fm">
        <input type="hidden" value="${goodsDetail.id}" name="id">
        <table width="25%" style="margin: 0px auto" border="all">
            <caption style="height: 50px;background-color: #A0A59F;color: blue;font-size: 35px">购买商品</caption>
            <tr>
                <td>商品编号</td>
                <td>${goodsDetail.id}</td>
            </tr>
            <tr>
                <td>商品名称</td>
                <td>${goodsDetail.name}</td>
            </tr>
            <tr>
                <td>商品分类</td>
                <td>${goodsDetail.sortName}</td>
            </tr>
            <tr>
                <td>单价(元)</td>
                <td id="price">${goodsDetail.price}</td>
            </tr>
            <tr>
                <td>剩余数量</td>
                <td id="surplus">${goodsDetail.remaining}</td>
            </tr>
            <tr>
                <td>购买数量</td>
                <td><input type="text" name="buyNum" value="0" id="buyNum"/> </td>
            </tr>
            <tr>
                <td>总金额(元)</td>
                <td id="sumprice">0.0</td>
            </tr>
            <tr>
                <td colspan="2" style="padding-left:30%">
                    <input type="button" id="buy" value="购买"/>
                    <a href="${pageContext.request.contextPath}/index.jsp"> <input type="button" value="返回"/></a>
                </td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>
